#ifndef CREATURE_H
#define CREATURE_H

#include "defines.h"

// The length of a move in pixels
#define MOVE_STEP 40 // pixels to move normally 
#define MOVE_SPEED 5 // Pixels to move when running
#define MAX_LIVES 4
#define START_Y_POS 70
#define START_X_POS 70

class Creature
{
private:
	// Number of lives left
	static signed short int m_iJumpLength;

	// Number of lives left
	signed short int m_iLives;

	// On screen positions
	signed int m_iXPos;
	signed int m_iYPos;

	// The radius(size) of the creature
	signed short int m_iRadius;
	
	// Scream time left (0-255)
	signed short int m_iScreamTimeLeft;

	// Scream time left (0-255)
	signed short int m_iEnergy;

	// Frames to pass before creature is rotated
	unsigned short int m_iRotationDelay;
	
	// The current rotation of the creature (0-511)
	unsigned short int m_iRotation;
		

	bool isPowerup();
	void HandleMovement();	
	
public:
	// Possible directions to move in
	enum e_Direction {UP, RIGHT, DOWN, LEFT};
		
	// Constructor
	Creature();

	// Move the creature
	void Move(e_Direction dir, unsigned int distance);
	
	// Get number of lives left
	unsigned int GetLivesLeft();
	unsigned int GetMaxLives();
	
	// Is creature hit at this position
	bool IsHit(int x, int y);
	
	// Is the creature in a mid-jump/move?
	bool IsMoving();
	
	// Time passes
	void Tick();
	
	// Decrement lives if possible
	int LifeDown();
	// Increment
	void LifeUp();
};

#endif // CREATURE_H
